import { Component } from 'react';
import { message} from 'antd';
import moment from 'moment';
//接口调用成功的提示
const success=(msg)=>{
  message.success(msg?msg:'操作成功');
}
//字符格式转为日期格式
const getDateByString=(string,format)=>{
  return moment(string,format)
}
//日期格式转字符格式
const getStringByDate=(date,format)=>{
  return moment(date).format("YYYY-MM-DD")
}
Component.prototype.success = success;
Component.prototype.getDateByString = getDateByString;
Component.prototype.getStringByDate = getStringByDate;

